@extends('layouts.tankuang')

@section('content')
    <form name="add_form" id="add_form" action="{{url('admin/units/add_baowei',$id)}}" method="post" enctype="multipart/form-data">
        <input type="hidden" name="_token" value="{{ csrf_token() }}">
        <div>
            <h2 class="text-center mg_b36 mg_t25" style="font-weight: bold;">重要部位登记表</h2>
            <table class="table-form table-border w mg-auto">
                <tr>
                    <td align="center" class="font-bd">单位名称</td>
                    <td colspan="2"><input type="text" class="form-input" value="{{$re->unit_name}}" name="unit_name"></td>
                    <td align="center" class="font-bd">要害部位编号</td>
                    <td><input type="text" class="form-input" value="{{$re->bianhao}}" name="bianhao"></td>
                </tr>
                <tr>
                    <td align="center" class="font-bd">要害部位名称</td>
                    <td colspan="2"><input type="text" class="form-input easyui-validatebox" value="{{$re->name}}" name="name" data-options="required:true,missingMessage:'部位名称不能为空',validateOnCreate:false,validateOnBlur:true"></td>
                    <td align="center" class="font-bd">安全负责人</td>
                    <td><input type="text" class="form-input easyui-validatebox" value="{{$re->fuzeren}}" name="fuzeren" data-options="required:true,missingMessage:'安全负责人不能为空',validateOnCreate:false,validateOnBlur:true"></td>
                </tr>
                <tr>
                    <td align="center" class="font-bd">要害部位等级</td>
                    <td colspan="2">
                        <select class="w153 input_all easyui-validatebox" name="dengji" data-options="required:true,missingMessage:'要害部位等级不能为空',validateOnCreate:false,validateOnBlur:true">
                            <option value="">请选择</option>
                            <option value="一级" @if($re->dengji == '一级')selected @endif>一级</option>
                            <option value="二级" @if($re->dengji == '二级')selected @endif>二级</option>
                            <option value="三级" @if($re->dengji == '三级')selected @endif>三级</option>
                        </select>
                    </td>
                    <td align="center" class="font-bd">要害类型</td>
                    <td>
                        <select class="w153 input_all easyui-validatebox" name="type" data-options="required:true,missingMessage:'要害类型不能为空',validateOnCreate:false,validateOnBlur:true">
                            <option value="">请选择</option>
                            @foreach($type as $v)
                                <option value="{{$v->name}}" @if($re->type == $v->name)selected @endif>{{$v->name}}</option>
                            @endforeach
                        </select>
                    </td>
                </tr>
                <tr><td colspan="5" style="background-color: #69CEE9;text-align: center">安全防范措施</td></tr>
                <tr>
                    <td align="center" class="font-bd">安全制度</td>
                    <td align="center" class="font-bd">要害部位安全管理制度</td>
                    <td>
                        <input type="radio" name="aqff_01" value="1" @if($re->aqff_01 == 1)checked @endif>有
                        <input type="radio" name="aqff_01" value="2" @if($re->aqff_01 == 2)checked @endif>无
                    </td>
                    <td align="center" class="font-bd">消防安全管理制度</td>
                    <td>
                        <input type="radio" name="aqff_02" value="1" @if($re->aqff_02 == 1)checked @endif>有
                        <input type="radio" name="aqff_02" value="2" @if($re->aqff_02 == 2)checked @endif>无
                    </td>
                </tr>
                <tr>
                    <td align="center" class="font-bd">人防情况</td>
                    <td align="center" class="font-bd">值守方式</td>
                    <td>
                        <select class="w153 input_all" name="aqff_03">
                            <option value="">请选择</option>
                            <option value="24小时值守" @if($re->aqff_03 == '24小时值守')selected @endif>24小时值守</option>
                            <option value="巡查" @if($re->aqff_03 == '巡查')selected @endif>巡查</option>
                            <option value="犬防" @if($re->aqff_03 == '犬防')selected @endif>犬防</option>
                            <option value="门卫" @if($re->aqff_03 == '门卫')selected @endif>门卫</option>
                            <option value="无人值守" @if($re->aqff_03 == '无人值守')selected @endif>无人值守</option>
                        </select>
                    </td>
                    <td align="center" class="font-bd">人员、车辆出入登记</td>
                    <td>
                        <input type="radio" name="aqff_04" value="1" @if($re->aqff_04 == 1)checked @endif>有
                        <input type="radio" name="aqff_04" value="2" @if($re->aqff_04 == 2)checked @endif>无
                    </td>
                </tr>
                <tr>
                    <td align="center" class="font-bd">物防情况</td>
                    <td align="center" class="font-bd">防护目标的门窗柜等物理设施</td>
                    <td>
                        <input type="radio" name="aqff_05" value="1" @if($re->aqff_05 == 1)checked @endif>有
                        <input type="radio" name="aqff_05" value="2" @if($re->aqff_05 == 2)checked @endif>无
                    </td>
                    <td align="center" class="font-bd">保安器材装备配置</td>
                    <td>
                        <input type="radio" name="aqff_06" value="1" @if($re->aqff_06 == 1)checked @endif>有
                        <input type="radio" name="aqff_06" value="2" @if($re->aqff_06 == 2)checked @endif>无
                    </td>
                </tr>
                <tr>
                    <td align="center" class="font-bd" rowspan="2">技防情况</td>
                    <td align="center" class="font-bd">视频监控系统</td>
                    <td>
                        <input type="radio" name="aqff_07" value="1" @if($re->aqff_07 == 1)checked @endif>有
                        <input type="radio" name="aqff_07" value="2" @if($re->aqff_07 == 2)checked @endif>无
                    </td>
                    <td align="center" class="font-bd">室内入侵报警系统</td>
                    <td>
                        <input type="radio" name="aqff_08" value="1" @if($re->aqff_08 == 1)checked @endif>有
                        <input type="radio" name="aqff_08" value="2" @if($re->aqff_08 == 2)checked @endif>无
                    </td>
                </tr>
                <tr>
                    <td align="center" class="font-bd">门禁系统</td>
                    <td>
                        <input type="radio" name="aqff_09" value="1" @if($re->aqff_09 == 1)checked @endif>有
                        <input type="radio" name="aqff_09" value="2" @if($re->aqff_09 == 2)checked @endif>无
                    </td>
                    <td align="center" class="font-bd">室外周界报警系统</td>
                    <td>
                        <input type="radio" name="aqff_10" value="1" @if($re->aqff_10 == 1)checked @endif>有
                        <input type="radio" name="aqff_10" value="2" @if($re->aqff_10 == 2)checked @endif>无
                    </td>
                </tr>
                <tr>
                    <td align="center" class="font-bd" rowspan="2">消防情况</td>
                    <td align="center" class="font-bd">疏散指示标志</td>
                    <td>
                        <input type="radio" name="aqff_11" value="1" @if($re->aqff_11 == 1)checked @endif>有
                        <input type="radio" name="aqff_11" value="2" @if($re->aqff_11 == 2)checked @endif>无
                    </td>
                    <td align="center" class="font-bd">应急照明灯具配备</td>
                    <td>
                        <input type="radio" name="aqff_12" value="1" @if($re->aqff_12 == 1)checked @endif>有
                        <input type="radio" name="aqff_12" value="2" @if($re->aqff_12 == 2)checked @endif>无
                    </td>
                </tr>
                <tr>
                    <td align="center" class="font-bd">消防设施及器材配备</td>
                    <td>
                        <input type="radio" name="aqff_13" value="1" @if($re->aqff_13 == 1)checked @endif>有
                        <input type="radio" name="aqff_13" value="2" @if($re->aqff_13 == 2)checked @endif>无
                    </td>
                    <td align="center" class="font-bd">灭火设备的操作</td>
                    <td>
                        <input type="radio" name="aqff_14" value="1" @if($re->aqff_14 == 1)checked @endif>有
                        <input type="radio" name="aqff_14" value="2" @if($re->aqff_14 == 2)checked @endif>无
                    </td>
                </tr>
                <tr><td colspan="5" style="background-color: #69CEE9;text-align: center">平面图</td></tr>
                <tr>
                    <td align="center" class="font-bd">平面图</td>
                    <td colspan="4">
                        @if($re->pic1 != '')
                            <div class="example"><img src="{{ URL::asset('/') }}{{$re->pic1}}" class="img-rounded" alt="" width="200" height="140"></div>
                        @endif
                        <input type="file" value="" name="pic1" class="w178">
                    </td>
                    {{--<td width="10%" align="center" class="font-bd">全景图</td>
                    <td width="16%"><input type="file" value="" name="pic2" class="w178"></td>
                    <td align="center" width="12%" class="font-bd">内部图</td>
                    <td width="16%"><input type="file" value="" name="pic3" class="w178"></td>--}}
                </tr>
                <tr>
                    <td align="center" class="font-bd">备注</td>
                    <td colspan="4">
                        <textarea class="textarea" name="remark">{{$re->remark}}</textarea>
                    </td>
                </tr>
            </table>
            {{--<div class="w wbt mg_t25 mg_b18">
                <span class="font-bd">填报单位：</span>
                <input type="text" class="w250 input_bottom dsp" name="">
                <span class="itv"></span>
                <span class="font-bd">填报人：</span>
                <input type="text" class="w250 input_bottom dsp">
            </div>--}}
            <div class="w wbt mg_t25 text-center">
                <button id="go" type="button" class="easyui-linkbutton dsp" data-options="iconCls:'icon-save'">确定</button>
                <a href="{{url('admin/units/print_zybw',$id)}}" target="_blank" id="goToPageB" class="easyui-linkbutton dsp print" data-options="iconCls:'icon-print'">打印</a>
                <button type="button" class="easyui-linkbutton dsp" data-options="iconCls:'icon-no'" onclick="$('#tk').window('close')">关闭</button>
            </div>
        </div>
    </form>


    <link rel="stylesheet" href="{{ URL::asset('/') }}css/zoomify.min.css">
    <script src="{{ URL::asset('/') }}js/zoomify.min.js"></script>
    <script type="text/javascript">
        $('.example img').zoomify(function(){
            $(this).css({'position':'absolute','top':0,'bottom':0,'left':0,'right':0,'z-index':'9999',})
        });
    </script>
    <script>
        $('#go').click(function (){
            var formData = new FormData($("#add_form")[0]);
            $.ajax({
                type: "POST",
                url: "{{url('admin/units/edit_zybw',$id)}}",
                data: formData,
                async: false,
                cache: false,
                contentType: false,
                processData: false,
                /*error: function(data) {
                    $.messager.alert('信息提示',data.msg,'info');
                },*/
                success: function(data) {
                    $.messager.alert('信息提示',data.msg,'info');
                    $('#tk').dialog('close');
                    $('.pagination-load').click();
                },
                error: function(msg) {
                    var json=JSON.parse(msg.responseText);
                    $.each(json, function(index, value) {
                        $.messager.alert('信息提示',value,'info');die;
                    });
                },
            });
        });
    </script>
    <script type="text/javascript">
        $(document).ready(function(){
            var tt =$("input[name=renfangtiaojian]:checked").val();
            if(tt == 4){
                $(".qita").attr('style','');
            }else{
                $(".qita").attr('style','display:none');
            }
        });

        $(function(){
            $("input[name=renfangtiaojian]").click(function(){
                var tt = $(this).val();
                if(tt == 4){
                    $(".qita").attr('style','');
                }else{
                    $(".qita").attr('style','display:none');
                }
            });
        });
    </script>
@stop